home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 276-300 / 288 / diskspeed / diskspeedwindow.c < prev    next >
C/C++ Source or Header  |  1995-03-14  |  17KB  |  582 lines

  1. /*
  2.  *                          DiskSpeed v2.0
  3.  *                                by
  4.  *                           Michael Sinz
  5.  *
  6.  *             Copyright (c) 1989 by MKSoft Development
  7.  *
  8.  *
  9.  * Yes, this is yet another disk speed testing program, but with a few
  10.  * differences.  It was designed to give the most accurate results of the
  11.  * true disk performance in the system.  For this reason many of
  12.  * DiskSpeed's results may look either lower or higher than current disk
  13.  * performance tests.
  14.  *
  15.  * This program was thrown together in a few hours because I needed more
  16.  * accurate and consistent results for disk performance as seen from the
  17.  * application's standpoint.  This program has now served its purpose and
  18.  * I am now giving it to the rest of the Amiga world to play with as long
  19.  * as all of the files remain together in unmodified form.  (That is, the
  20.  * files DiskSpeed, DiskSpeed.info, DiskSpeed.c, DiskSpeedWindow.c,
  21.  * DiskSpeedWindow.h, MakeBoxes.c, MakeBoxes.h, StandardGadgets.c,
  22.  * StandardGadgets.h, RenderInfo.c, RenderInfo.h, DiskSpeed.doc, and
  23.  * MakeFile)
  24.  *
  25.  * Version 2.0 of this program added a few features and cleaned up the
  26.  * user interface.  I hope you like this...
  27.  *
  28.  ******************************************************************************
  29.  *                                          *
  30.  *    Reading legal mush can turn your bain into guacamole!              *
  31.  *                                          *
  32.  *        So here is some of that legal mush:                  *
  33.  *                                          *
  34.  * Permission is hereby granted to distribute this program's source          *
  35.  * executable, and documentation for non-commercial purposes, so long as the  *
  36.  * copyright notices are not removed from the sources, executable or          *
  37.  * documentation.  This program may not be distributed for a profit without   *
  38.  * the express written consent of the author Michael Sinz.              *
  39.  *                                          *
  40.  * This program is not in the public domain.                      *
  41.  *                                          *
  42.  * Fred Fish is expressly granted permission to distribute this program's     *
  43.  * source and executable as part of the "Fred Fish freely redistributable     *
  44.  * Amiga software library."                              *
  45.  *                                          *
  46.  * Permission is expressly granted for this program and it's source to be     *
  47.  * distributed as part of the Amicus Amiga software disks, and the          *
  48.  * First Amiga User Group's Hot Mix disks.                      *
  49.  *                                          *
  50.  ******************************************************************************
  51.  *
  52.  * This is the window opening and definition code...
  53.  */
  54.  
  55. #include    <exec/types.h>
  56. #include    <exec/memory.h>
  57. #include    <devices/timer.h>
  58. #include    <intuition/intuition.h>
  59.  
  60. #include    <proto/all.h>
  61.  
  62. #include    <string.h>
  63.  
  64. #include    "RenderInfo.h"
  65. #include    "StandardGadgets.h"
  66. #include    "MakeBoxes.h"
  67. #include    "DiskSpeedWindow.h"
  68.  
  69. static char DiskSpeedTitle[14]="DiskSpeed 2.0";
  70. static char WindowText[57]="DiskSpeed 2.0 - Copyright (c) 1989 by MKSoft Development";
  71. static char Dashes[10]="---------";
  72.  
  73. static char fontnam[11]="topaz.font";
  74. static struct TextAttr TOPAZ80={fontnam,TOPAZ_EIGHTY,0,0};
  75.  
  76. #define    TEXT_BUFFER_SIZE    1000L
  77.  
  78. #define    WINDOW_WIDTH    531
  79. #define    WINDOW_HEIGHT    161
  80.  
  81. #define    REQ_X_SIZE    518
  82. #define    REQ_Y_SIZE    136
  83.  
  84. #define    BOX_OUT    0
  85. #define    BOX_IN    1
  86.  
  87. struct BoxType
  88. {
  89.     SHORT    x1,y1;
  90.     SHORT    x2,y2;
  91.     SHORT    type;
  92. };
  93.  
  94. struct Text_Info
  95. {
  96.     SHORT    x,y;
  97.     char    *text;
  98. };
  99.  
  100. struct Gadget_Info
  101. {
  102.     SHORT    x,y;
  103.     SHORT    size;
  104.     SHORT    flags;
  105.     USHORT    ID;
  106.     char    *text;
  107. };
  108.  
  109. struct Result_Info
  110. {
  111.     SHORT    x,y;
  112. };
  113.  
  114. static    struct BoxType BoxTypes[NUM_BOXES]=
  115. {
  116.     {0,0,        WINDOW_WIDTH-1,WINDOW_HEIGHT-1,    BOX_OUT},
  117.     {70,20,        249,31,                BOX_IN},
  118.     {70,37,        524,48,                BOX_IN},
  119.     {16,55,        516,102,            BOX_IN},
  120.     {16,106,    265,154,            BOX_IN},
  121.     {274,106,    373,154,            BOX_IN},
  122.     {143,68,    226,98,                BOX_IN},
  123.     {236,68,    319,98,                BOX_IN},
  124.     {329,68,    412,98,                BOX_IN},
  125.     {422,68,    505,98,                BOX_IN},
  126.     {171,110,    254,150,            BOX_IN},
  127.     {282,127,    365,137,            BOX_IN}
  128. };
  129.  
  130. static    struct Text_Info TextInfo[NUM_TEXT]=
  131. {
  132.     {8,22,        "Device:"},
  133.     {8,39,        "Comment"},
  134.     {265,22,    "Test Intensity:"},
  135.     {24,59,        "Buffer Size"},
  136.     {24,70,        "Bytes/s Create"},
  137.     {24,80,        "Bytes/s Write"},
  138.     {24,90,        "Bytes/s Read"},
  139.     {197,59,    "512"},
  140.     {282,59,    "4096"},
  141.     {367,59,    "32768"},
  142.     {452,59,    "262144"},
  143.     {24,112,    "Files/s Create"},
  144.     {24,122,    "Files/s Open/Close"},
  145.     {24,132,    "Files/s Scan"},
  146.     {24,142,    "Files/s Delete"},
  147.     {288,118,    "Seek/Read"}
  148. };
  149.  
  150. static    struct Gadget_Info GadgetInfo[NUM_GADGETS]=
  151. {
  152.     {387,19,    41,    GADGIMMEDIATE|TOGGLESELECT,    GADGET_HIGH,    "High"},
  153.     {435,19,    41,    GADGIMMEDIATE|TOGGLESELECT,    GADGET_MED,    "Med"},
  154.     {483,19,    41,    GADGIMMEDIATE|TOGGLESELECT,    GADGET_LOW,    "Low"},
  155.  
  156.     {391,107,    116,    RELVERIFY,    GADGET_START,    "Start Test"},
  157.     {391,124,    116,    RELVERIFY,    GADGET_SAVE,    "Save Results"},
  158.     {391,141,    116,    RELVERIFY,    GADGET_PRINT,    "Print Results"}
  159. };
  160.  
  161. static    struct Result_Info ResultInfo[NUM_RESULTS]=
  162. {
  163.     {149,70},    {149,80},    {149,90},
  164.     {242,70},    {242,80},    {242,90},
  165.     {335,70},    {335,80},    {335,90},
  166.     {428,70},    {428,80},    {428,90},
  167.  
  168.     {177,112},    {177,122},    {177,132},    {177,142},
  169.  
  170.     {288,129}
  171. };
  172.  
  173. /*
  174.  * This define is for the Write_Results routine...
  175.  */
  176. #define    MYCAT(z,y,x)    for (y=x;*y;*z++=*y++)
  177. #define    MYCATNEWLINE(x)    *x++='\n'
  178. #define    MYCATTAB(x)    *x++='\t'
  179. #define    MYCATSPACE(x)    *x++=' '
  180.  
  181. /*
  182.  * This routine builds a string of the results and then writes it to
  183.  * the file passed...
  184.  */
  185. VOID Write_Results(struct MyWindow *MyWindow,BPTR TheFile)
  186. {
  187. register    char    *t;
  188. register    char    *h;
  189. register    char    *Buffer;
  190.  
  191.     if (t=Buffer=AllocMem(TEXT_BUFFER_SIZE,MEMF_PUBLIC|MEMF_CLEAR))
  192.     {
  193.  
  194. /* Title and device name */
  195.         MYCATNEWLINE(t);
  196.         MYCAT(t,h,WindowText);
  197.         MYCATNEWLINE(t);
  198.         MYCATNEWLINE(t);
  199.         MYCAT(t,h,TextInfo[0].text);
  200.         MYCATTAB(t);
  201.         MYCAT(t,h,MyWindow->DeviceName);
  202.         MYCATNEWLINE(t);
  203.         MYCATNEWLINE(t);
  204.         if (MyWindow->Comment[0])
  205.         {
  206.             MYCAT(t,h,TextInfo[1].text);
  207.             MYCATTAB(t);
  208.             MYCAT(t,h,MyWindow->Comment);
  209.             MYCATNEWLINE(t);
  210.             MYCATNEWLINE(t);
  211.         }
  212.  
  213. /* Tell of the test intensity... */
  214.         MYCAT(t,h,TextInfo[2].text);
  215.         MYCATSPACE(t);
  216.         switch(MyWindow->TestFlag)
  217.         {
  218.         case GADGET_HIGH:    MYCAT(t,h,GadgetInfo[0].text);
  219.                     break;
  220.         case GADGET_MED:    MYCAT(t,h,GadgetInfo[1].text);
  221.                     break;
  222.         case GADGET_LOW:    MYCAT(t,h,GadgetInfo[2].text);
  223.                     break;
  224.         }
  225.         MYCATNEWLINE(t);
  226.         MYCATNEWLINE(t);
  227.  
  228. /* File Create */
  229.         MYCAT(t,h,MyWindow->MyResults[RESULTS_CREATE].text);
  230.         MYCATSPACE(t);
  231.         MYCAT(t,h,TextInfo[11].text);
  232.         MYCATNEWLINE(t);
  233.  
  234. /* File Open/Close */
  235.         MYCAT(t,h,MyWindow->MyResults[RESULTS_OPEN_CLOSE].text);
  236.         MYCATSPACE(t);
  237.         MYCAT(t,h,TextInfo[12].text);
  238.         MYCATNEWLINE(t);
  239.  
  240. /* File Scan */
  241.         MYCAT(t,h,MyWindow->MyResults[RESULTS_DIR_SCAN].text);
  242.         MYCATSPACE(t);
  243.         MYCAT(t,h,TextInfo[13].text);
  244.         MYCATNEWLINE(t);
  245.  
  246. /* File Delete */
  247.         MYCAT(t,h,MyWindow->MyResults[RESULTS_DELETE].text);
  248.         MYCATSPACE(t);
  249.         MYCAT(t,h,TextInfo[14].text);
  250.         MYCATNEWLINE(t);
  251.  
  252.         MYCATNEWLINE(t);
  253.  
  254. /* Seek and Read */
  255.         MYCAT(t,h,MyWindow->MyResults[RESULTS_SEEK_READ].text);
  256.         MYCATSPACE(t);
  257.         MYCAT(t,h,TextInfo[15].text);
  258.         MYCATNEWLINE(t);
  259.  
  260.         MYCATNEWLINE(t);
  261.  
  262. /* Titles... */
  263.         MYCAT(t,h,TextInfo[3].text);
  264.         MYCATTAB(t);
  265.         MYCAT(t,h,TextInfo[7].text);
  266.         MYCATTAB(t);
  267.         MYCATTAB(t);
  268.         MYCAT(t,h,TextInfo[8].text);
  269.         MYCATTAB(t);
  270.         MYCATTAB(t);
  271.         MYCAT(t,h,TextInfo[9].text);
  272.         MYCATTAB(t);
  273.         MYCATTAB(t);
  274.         MYCAT(t,h,TextInfo[10].text);
  275.         MYCATNEWLINE(t);
  276. /* Dash it all...  :-) */
  277.         MYCAT(t,h,Dashes);
  278.         MYCATTAB(t);
  279.         MYCAT(t,h,Dashes);
  280.         MYCATTAB(t);
  281.         MYCAT(t,h,Dashes);
  282.         MYCATTAB(t);
  283.         MYCAT(t,h,Dashes);
  284.         MYCATTAB(t);
  285.         MYCAT(t,h,Dashes);
  286.         MYCATNEWLINE(t);
  287.  
  288. /* Create Speed */
  289.         MYCAT(t,h,TextInfo[4].text);
  290.         MYCATTAB(t);
  291.         MYCAT(t,h,MyWindow->MyResults[RESULTS_512_CREATE].text);
  292.         MYCATTAB(t);
  293.         MYCAT(t,h,MyWindow->MyResults[RESULTS_4096_CREATE].text);
  294.         MYCATTAB(t);
  295.         MYCAT(t,h,MyWindow->MyResults[RESULTS_32768_CREATE].text);
  296.         MYCATTAB(t);
  297.         MYCAT(t,h,MyWindow->MyResults[RESULTS_262144_CREATE].text);
  298.         MYCATNEWLINE(t);
  299.  
  300. /* Write Speed */
  301.         MYCAT(t,h,TextInfo[4].text);
  302.         MYCATTAB(t);
  303.         MYCAT(t,h,MyWindow->MyResults[RESULTS_512_WRITE].text);
  304.         MYCATTAB(t);
  305.         MYCAT(t,h,MyWindow->MyResults[RESULTS_4096_WRITE].text);
  306.         MYCATTAB(t);
  307.         MYCAT(t,h,MyWindow->MyResults[RESULTS_32768_WRITE].text);
  308.         MYCATTAB(t);
  309.         MYCAT(t,h,MyWindow->MyResults[RESULTS_262144_WRITE].text);
  310.         MYCATNEWLINE(t);
  311.  
  312. /* Read Speed */
  313.         MYCAT(t,h,TextInfo[4].text);
  314.         MYCATTAB(t);
  315.         MYCAT(t,h,MyWindow->MyResults[RESULTS_512_READ].text);
  316.         MYCATTAB(t);
  317.         MYCAT(t,h,MyWindow->MyResults[RESULTS_4096_READ].text);
  318.         MYCATTAB(t);
  319.         MYCAT(t,h,MyWindow->MyResults[RESULTS_32768_READ].text);
  320.         MYCATTAB(t);
  321.         MYCAT(t,h,MyWindow->MyResults[RESULTS_262144_READ].text);
  322.         MYCATNEWLINE(t);
  323.  
  324.         MYCATNEWLINE(t);
  325.         MYCATNEWLINE(t);
  326.  
  327. /* Now, all we have to do is write the sucker... */
  328.         Write(TheFile,Buffer,t-Buffer);
  329.  
  330.         FreeMem(Buffer,TEXT_BUFFER_SIZE);
  331.     }
  332. }
  333.  
  334. VOID CloseMyWindow(struct MyWindow *MyWin)
  335. {
  336.     if (MyWin)
  337.     {
  338.         if (MyWin->Window)
  339.         {
  340.             if (MyWin->DragGadget) RemDragGadget(MyWin->DragGadget);
  341.             if (MyWin->FrontBackGadget) RemFrontBackGadget(MyWin->FrontBackGadget);
  342.             if (MyWin->CloseGadget) RemCloseGadget(MyWin->CloseGadget);
  343.             CloseWindow(MyWin->Window);
  344.         }
  345.         FreeMem(MyWin,sizeof(struct MyWindow));
  346.     }
  347. }
  348.  
  349. struct MyWindow *OpenMyWindow(struct RenderInfo *ri)
  350. {
  351. register        SHORT        loop;
  352. register    struct    MyWindow    *MyWin;
  353. register    struct    Border        *MyBorder;
  354. register    struct    IntuiText    *itext;
  355. register    struct    Gadget        *gad;
  356.         struct    NewWindow    nw;
  357.  
  358.     if (MyWin=AllocMem(sizeof(struct MyWindow),MEMF_PUBLIC|MEMF_CLEAR))
  359.     {
  360.  
  361. /* First, set up the requester structures... */
  362.         MyWin->Req.LeftEdge=7;
  363.         MyWin->Req.TopEdge=19;
  364.         MyWin->Req.Width=REQ_X_SIZE;
  365.         MyWin->Req.Height=REQ_Y_SIZE;
  366.         MyWin->Req.BackFill=ri->BackPen;
  367.         MyWin->Req.ReqGadget=&(MyWin->ReqGadget);
  368.  
  369.         MyWin->ReqGadget.Width=REQ_X_SIZE;
  370.         MyWin->ReqGadget.Height=REQ_Y_SIZE;
  371.         MyWin->ReqGadget.Flags=GADGHIMAGE;
  372.         MyWin->ReqGadget.Activation=RELVERIFY;
  373.         MyWin->ReqGadget.GadgetType=BOOLGADGET|REQGADGET;
  374.         MyWin->ReqGadget.GadgetRender=(APTR)&(MyWin->ReqBorders[0]);
  375.         MyWin->ReqGadget.SelectRender=(APTR)&(MyWin->ReqBorders[2]);
  376.         MyWin->ReqGadget.GadgetText=&(MyWin->ReqIText);
  377.         MyWin->ReqGadget.GadgetID=GADGET_REQ;
  378.  
  379.         MyWin->ReqBorders[0].NextBorder=&(MyWin->ReqBorders[1]);
  380.         MyWin->ReqBorders[2].NextBorder=&(MyWin->ReqBorders[3]);
  381.         MyWin->ReqBorders[0].XY=MyWin->ReqBorders[2].XY=MyWin->ReqVector1;
  382.         MyWin->ReqBorders[1].XY=MyWin->ReqBorders[3].XY=MyWin->ReqVector2;
  383.         for (loop=0;loop<4;loop++)
  384.         {
  385.             MyWin->ReqBorders[loop].Count=8;
  386.             MyWin->ReqBorders[loop].DrawMode=JAM1;
  387.         }
  388.         MyWin->ReqBorders[0].FrontPen=MyWin->ReqBorders[3].FrontPen=ri->Highlight;
  389.         MyWin->ReqBorders[1].FrontPen=MyWin->ReqBorders[2].FrontPen=ri->Shadow;
  390.         FillTopLeftDouble_Border(&(MyWin->ReqBorders[0]),REQ_X_SIZE,REQ_Y_SIZE);
  391.         FillBottomRightDouble_Border(&(MyWin->ReqBorders[1]),REQ_X_SIZE,REQ_Y_SIZE);
  392.  
  393.         MyWin->ReqIText.FrontPen=ri->TextPen;
  394.         MyWin->ReqIText.DrawMode=JAM1;
  395.         MyWin->ReqIText.TopEdge=(REQ_Y_SIZE>>1)-8;
  396.         MyWin->ReqIText.ITextFont=&TOPAZ80;
  397.  
  398. /* Now for the window gadgets... */
  399.         gad=&(MyWin->Detail);
  400.         gad->Flags=GADGHNONE;
  401.         gad->GadgetType=BOOLGADGET;
  402.  
  403.         nw.LeftEdge=20;
  404.         nw.TopEdge=11;
  405.         nw.Width=WINDOW_WIDTH;
  406.         nw.Height=WINDOW_HEIGHT;
  407.         nw.IDCMPFlags=GADGETDOWN|GADGETUP|CLOSEWINDOW|ACTIVEWINDOW;
  408.         nw.Flags=SIMPLE_REFRESH|BORDERLESS|ACTIVATE|NOCAREREFRESH|RMBTRAP;
  409.         nw.FirstGadget=gad;
  410.         nw.CheckMark=NULL;
  411.         nw.Title=NULL;
  412.         nw.Type=WBENCHSCREEN;
  413.  
  414.         MyBorder=NULL;
  415.         for (loop=0;loop<(NUM_BOXES*2);loop++)
  416.         {
  417.             MyWin->Details[loop].Border.NextBorder=MyBorder;
  418.             MyBorder=&(MyWin->Details[loop].Border);
  419.             MyBorder->XY=MyWin->Details[loop].Vectors;
  420.             MyBorder->FrontPen=ri->Highlight;
  421.             MyBorder->DrawMode=JAM1;
  422.             MyBorder->Count=5;
  423.         }
  424.         gad->GadgetRender=(APTR)MyBorder;
  425.  
  426.         for (loop=0;loop<NUM_BOXES;loop++)
  427.         {
  428.             MyWin->Details[loop*2].Border.LeftEdge=BoxTypes[loop].x1;
  429.             MyWin->Details[loop*2].Border.TopEdge=BoxTypes[loop].y1;
  430.             FillTopLeft_Border(&(MyWin->Details[loop*2].Border),
  431.                     BoxTypes[loop].x2-BoxTypes[loop].x1+1,
  432.                     BoxTypes[loop].y2-BoxTypes[loop].y1+1);
  433.             if (BOX_IN==BoxTypes[loop].type) MyWin->Details[loop*2].Border.FrontPen=ri->Shadow;
  434.  
  435.             MyWin->Details[loop*2+1].Border.LeftEdge=BoxTypes[loop].x1;
  436.             MyWin->Details[loop*2+1].Border.TopEdge=BoxTypes[loop].y1;
  437.             FillBottomRight_Border(&(MyWin->Details[loop*2+1].Border),
  438.                     BoxTypes[loop].x2-BoxTypes[loop].x1+1,
  439.                     BoxTypes[loop].y2-BoxTypes[loop].y1+1);
  440.             if (BOX_OUT==BoxTypes[loop].type) MyWin->Details[loop*2+1].Border.FrontPen=ri->Shadow;
  441.         }
  442.  
  443.         itext=NULL;
  444.  
  445.         for (loop=NUM_RESULTS-1;loop>=0;loop--)
  446.         {
  447.             MyWin->MyResults[loop].IntuiText.NextText=itext;
  448.             itext=&(MyWin->MyResults[loop].IntuiText);
  449.             itext->FrontPen=ri->TextPen;
  450.             itext->BackPen=ri->BackPen;
  451.             itext->DrawMode=JAM2;
  452.             itext->LeftEdge=ResultInfo[loop].x;
  453.             itext->TopEdge=ResultInfo[loop].y;
  454.             itext->ITextFont=&TOPAZ80;
  455.             itext->IText=MyWin->MyResults[loop].text;
  456.         }
  457.         for (loop=0;loop<NUM_TEXT;loop++)
  458.         {
  459.             MyWin->TextDetails[loop].NextText=itext;
  460.             itext=&(MyWin->TextDetails[loop]);
  461.             itext->FrontPen=ri->TextPen;
  462.             itext->DrawMode=JAM1;
  463.             itext->LeftEdge=TextInfo[loop].x;
  464.             itext->TopEdge=TextInfo[loop].y;
  465.             itext->ITextFont=&TOPAZ80;
  466.             itext->IText=TextInfo[loop].text;
  467.         }
  468.         gad->GadgetText=itext;
  469.  
  470.         for (loop=0;loop<NUM_GADGETS;loop++)
  471.         {
  472.             gad->NextGadget=&(MyWin->MyGadgets[loop].Gadget);
  473.             gad=gad->NextGadget;
  474.  
  475.             gad->LeftEdge=GadgetInfo[loop].x;
  476.             gad->TopEdge=GadgetInfo[loop].y;
  477.             gad->Width=GadgetInfo[loop].size;
  478.             gad->Height=14;
  479.             gad->Flags=GADGHIMAGE;
  480.             gad->Activation=GadgetInfo[loop].flags;
  481.             gad->GadgetType=BOOLGADGET;
  482.             gad->GadgetRender=(APTR)&(MyWin->MyGadgets[loop].Borders[0]);
  483.             gad->SelectRender=(APTR)&(MyWin->MyGadgets[loop].Borders[2]);
  484.             gad->GadgetText=&(MyWin->MyGadgets[loop].IntuiText);
  485.             gad->GadgetID=GadgetInfo[loop].ID;
  486.             if (GadgetInfo[loop].ID==GADGET_MED)
  487.             {
  488.                 gad->Flags|=SELECTED;
  489.                 MyWin->TestFlag=GadgetInfo[loop].ID;
  490.             }
  491.  
  492.             MyWin->MyGadgets[loop].Borders[0].NextBorder=&(MyWin->MyGadgets[loop].Borders[1]);
  493.             MyWin->MyGadgets[loop].Borders[2].NextBorder=&(MyWin->MyGadgets[loop].Borders[3]);
  494.  
  495.             MyWin->MyGadgets[loop].Borders[0].DrawMode=JAM1;
  496.             MyWin->MyGadgets[loop].Borders[1].DrawMode=JAM1;
  497.             MyWin->MyGadgets[loop].Borders[2].DrawMode=JAM1;
  498.             MyWin->MyGadgets[loop].Borders[3].DrawMode=JAM1;
  499.  
  500.             MyWin->MyGadgets[loop].Borders[0].FrontPen=ri->Highlight;
  501.             MyWin->MyGadgets[loop].Borders[1].FrontPen=ri->Shadow;
  502.             MyWin->MyGadgets[loop].Borders[2].FrontPen=ri->Shadow;
  503.             MyWin->MyGadgets[loop].Borders[3].FrontPen=ri->Highlight;
  504.  
  505.             MyWin->MyGadgets[loop].Borders[0].XY=MyWin->MyGadgets[loop].Vectors1;
  506.             MyWin->MyGadgets[loop].Borders[1].XY=MyWin->MyGadgets[loop].Vectors2;
  507.             MyWin->MyGadgets[loop].Borders[2].XY=MyWin->MyGadgets[loop].Vectors1;
  508.             MyWin->MyGadgets[loop].Borders[3].XY=MyWin->MyGadgets[loop].Vectors2;
  509.  
  510.             MyWin->MyGadgets[loop].Borders[0].Count=8;
  511.             MyWin->MyGadgets[loop].Borders[1].Count=8;
  512.             MyWin->MyGadgets[loop].Borders[2].Count=8;
  513.             MyWin->MyGadgets[loop].Borders[3].Count=8;
  514.  
  515.             FillTopLeftDouble_Border(&(MyWin->MyGadgets[loop].Borders[0]),GadgetInfo[loop].size,14);
  516.             FillBottomRightDouble_Border(&(MyWin->MyGadgets[loop].Borders[1]),GadgetInfo[loop].size,14);
  517.  
  518.             MyWin->MyGadgets[loop].IntuiText.TopEdge=3;
  519.             MyWin->MyGadgets[loop].IntuiText.FrontPen=ri->TextPen;
  520.             MyWin->MyGadgets[loop].IntuiText.DrawMode=JAM1;
  521.             MyWin->MyGadgets[loop].IntuiText.ITextFont=&TOPAZ80;
  522.             MyWin->MyGadgets[loop].IntuiText.IText=GadgetInfo[loop].text;
  523.             MyWin->MyGadgets[loop].IntuiText.LeftEdge=
  524.                 (GadgetInfo[loop].size-IntuiTextLength(&(MyWin->MyGadgets[loop].IntuiText))) >> 1;
  525.         }
  526.  
  527.         gad->NextGadget=&(MyWin->DeviceGadget);
  528.         gad=gad->NextGadget;
  529.         gad->LeftEdge=72;
  530.         gad->TopEdge=22;
  531.         gad->Width=176;
  532.         gad->Height=9;
  533.         gad->Activation=RELVERIFY;
  534.         gad->GadgetType=STRGADGET;
  535.         gad->SpecialInfo=(APTR)&(MyWin->DeviceGadgetInfo);
  536.         gad->GadgetID=GADGET_STRING;
  537.         gad->UserData=(APTR)&(MyWin->CommentGadget);
  538.         MyWin->DeviceGadgetInfo.Buffer=MyWin->DeviceName;
  539.         MyWin->DeviceGadgetInfo.MaxChars=32;
  540.  
  541.         gad->NextGadget=&(MyWin->CommentGadget);
  542.         gad=gad->NextGadget;
  543.         gad->LeftEdge=72;
  544.         gad->TopEdge=39;
  545.         gad->Width=451;
  546.         gad->Height=9;
  547.         gad->Activation=RELVERIFY;
  548.         gad->GadgetType=STRGADGET;
  549.         gad->SpecialInfo=(APTR)&(MyWin->CommentGadgetInfo);
  550.         gad->GadgetID=GADGET_STRING;
  551.         gad->UserData=(APTR)&(MyWin->DeviceGadget);
  552.         MyWin->CommentGadgetInfo.Buffer=MyWin->Comment;
  553.         MyWin->CommentGadgetInfo.MaxChars=80;
  554.  
  555.         gad->NextGadget=&(MyWin->Background);
  556.         gad=gad->NextGadget;
  557.         gad->Flags=GADGHNONE|GADGIMAGE;
  558.         gad->GadgetType=BOOLGADGET;
  559.         gad->GadgetRender=(APTR)&(MyWin->Image_Background);
  560.         MyWin->Image_Background.Width=WINDOW_WIDTH;
  561.         MyWin->Image_Background.Height=WINDOW_HEIGHT;
  562.         MyWin->Image_Background.PlaneOnOff=ri->BackPen;
  563.  
  564.         loop=FALSE;
  565.         if (MyWin->Window=OpenWindow(&nw))
  566.          if (MyWin->CloseGadget=AddCloseGadget(MyWin->Window,ri,7,3))
  567.           if (MyWin->FrontBackGadget=AddFrontBackGadget(MyWin->Window,ri,473,3))
  568.            if (MyWin->DragGadget=AddDragGadget(MyWin->Window,ri,DiskSpeedTitle,33,3,438))
  569.            {
  570.             loop=TRUE;
  571.            }
  572.  
  573.         if (!loop)
  574.         {
  575.             CloseMyWindow(MyWin);
  576.             MyWin=NULL;
  577.         }
  578.         else SetWindowTitles(MyWin->Window,(UBYTE *)-1L,WindowText);
  579.     }
  580.     return(MyWin);
  581. }
  582.